﻿using System;
using System.ComponentModel.DataAnnotations;

namespace WomanMotion.WebApi.Model.Dtos.Users
{
    /// <summary>
    /// 用户更新DTO
    /// </summary>
    public class UpdateUserDTO : BaseUpdateDTO
    {
        /// <summary>
        /// 用户名
        /// </summary>
        [Required(ErrorMessage = "用户名不能为空")]
        [MaxLength(10, ErrorMessage = "用户名不能大于10个字符")]
        [MinLength(3, ErrorMessage = "用户名不能小于3个字符")]
        public string? Name { get; set; }

        /// <summary>
        /// 用户头像
        /// </summary>
        public string? Photo { get; set; }

        /// <summary>
        /// 角色ID
        /// </summary>
        [Required(ErrorMessage = "角色ID不能为空")]
        public long Roleid { get; set; }

        /// <summary>
        /// 手机号码
        /// </summary>
        [Required(ErrorMessage = "手机号不能为空")]
        [RegularExpression(@"^1[3458][0-9]{9}$", ErrorMessage = "手机号格式不正确")]
        public string? Phone { get; set; } //[Range(, , ErrorMessage = "年纪必须在0-99之间")]

        /// <summary>
        /// 邮箱
        /// </summary>
        [Required(ErrorMessage = "邮箱不能为空")]
        [EmailAddress(ErrorMessage = "输入正确的邮箱格式")]
        public string? Email { get; set; }

        /// <summary>
        /// 微信ID
        /// </summary>
        public string? Wxid { get; set; }
    }
}